﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace _2015.DataCoresp
{
    public partial class DataCorepAddTrainingProg : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ButtonAdd_Click(object sender, EventArgs e)
        {
            string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
            using (SqlConnection con = new SqlConnection(CS))
            {
                SqlCommand cm = new SqlCommand("spAddPro", con);
                cm.CommandType = System.Data.CommandType.StoredProcedure;

                cm.Parameters.AddWithValue("@Training_program_NAME", TextBox_AddTrain.Text);
                cm.Parameters.AddWithValue("@NO_OF_TRAINEES", Convert.ToInt32(TextBoxTrNo.Text));
                cm.Parameters.AddWithValue("@ALLOCATED_BUDGET", Convert.ToInt32(TextBoxBudget.Text));

                con.Open();
                cm.ExecuteNonQuery();
                Response.Write("Successful");
            }
        }
    }
}